package com.itheima.springbootinit;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class Helloworld {

    @Value("${name}")
    private String name;
    @Value("${person.name}")
    private String name2;
    @Value("${person.age}")
    private int age;
    @RequestMapping("/hello2")
    public String hello2(){
        System.out.println(name);
        System.out.println(name2);
        System.out.println(age);
return "hello spring boot 22";
    }
    @RequestMapping("/hello")
    public String hello(){
        return "hello spring boot 22";
    }
}
